home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 May / EnigmA AMIGA RUN 18 (1997)(G.R. Edizioni)(IT)[!][issue 1997-05][EAR-CD II].iso / earcd / misc / emu / arosdev.lha / AROS / docs / src / adocpost.gawk < prev    next >
Text File  |  1997-01-28  |  5KB  |  291 lines

  1. BEGIN {
  2.     cols=3;
  3.     if (mode=="pre_bylib")
  4.     {
  5.     }
  6.     else if (mode=="post_bylib")
  7.     {
  8.     print "<DL>"
  9.     first=1;
  10.     dl=1;
  11.     }
  12.     if (mode=="pre_byname")
  13.     {
  14.     }
  15.     else if (mode=="post_byname")
  16.     {
  17.     first=1;
  18.     print "<DL>"
  19.     dl=1;
  20.     table=0;
  21.     }
  22. }
  23.  {
  24.     if (mode=="pre_bylib")
  25.     {
  26.     file=$1;
  27.     gsub("..\/html\/","",file);
  28.     first=toupper(substr($2,1,1));
  29.     libs[$3]=libs[$3] first;
  30.     print $3":"first":"$2":"file;
  31.     }
  32.     else if (mode=="post_bylib")
  33.     {
  34.     if ($1=="-")
  35.     {
  36.         if (first)
  37.         {
  38.         print "<A NAME=\"bylib\"></A><DT><FONT SIZE=\"+2\"><B>A.2 Reference by library</B></FONT><DD><DL>"
  39.         dl++;
  40.         first=0;
  41.         cnt=1;
  42.         }
  43.  
  44.         print "<FONT SIZE=\"+1\">"
  45.  
  46.         if ($2=="Utility functions")
  47.         print "<A HREF=\"#util\">"
  48.         else
  49.         print "<A HREF=\"#lib"$2"\">"
  50.  
  51.         print "<B>A.2."cnt" "$2"</B></A> ("
  52.         cnt ++;
  53.  
  54.         libini[$2]=$3;
  55.  
  56.         initials=$3;
  57.         for (t=1; t<=length(initials); t++)
  58.         {
  59.         c=substr(initials,t,1);
  60.         print "<A HREF=\"#lib"$2 c"\"><FONT SIZE=\"+1\"><B>"c"</B></FONT></A> "
  61.         }
  62.  
  63.         print ")</FONT><BR>"
  64.  
  65.         lib="";
  66.         char="";
  67.     }
  68.     else
  69.     {
  70.         if (lib != $1)
  71.         {
  72.         if (table)
  73.         {
  74.             while (horiz && horiz < cols)
  75.             {
  76.             print "<TD WIDTH=25%> </TD>"
  77.             horiz++;
  78.             }
  79.             print "</TR></TABLE>"
  80.             table=0;
  81.         }
  82.  
  83.         if (lib != "")
  84.         {
  85.             print "</DL><P>"
  86.             dl--;
  87.         }
  88.         else
  89.         {
  90.             print "<P>"
  91.             cnt=1;
  92.         }
  93.  
  94.         lib = $1;
  95.  
  96.         print "<P><DT>"
  97.  
  98.         if (lib=="Utility functions")
  99.             print "<A NAME=\"util\"></A>"
  100.         else
  101.             print "<A NAME=\"lib"lib"\"></A>"
  102.  
  103.         print "<FONT SIZE=\"+1\"><B>A.2."cnt " " $1"</B></FONT><DD>"
  104.         cnt ++;
  105.  
  106.         initials=libini[lib];
  107.         for (t=1; t<=length(initials); t++)
  108.         {
  109.             c=substr(initials,t,1);
  110.             print "<A HREF=\"#lib"lib c"\"><FONT SIZE=\"+1\"><B>"c"</B></FONT></A> "
  111.         }
  112.  
  113.         print "<P><DL>"
  114.         dl++;
  115.         }
  116.         if (char != $2)
  117.         {
  118.         char=$2;
  119.  
  120.         if (table)
  121.         {
  122.             while (horiz && horiz < cols)
  123.             {
  124.             print "<TD WIDTH=25%> </TD>"
  125.             horiz++;
  126.             }
  127.             print "</TR></TABLE>"
  128.             table=0;
  129.         }
  130.  
  131.         print "<DT>"
  132.         print "<A NAME=\"lib"lib char"\"></A>"
  133.         print "<B>"char"</B><DD>"
  134.  
  135.         print "<TABLE WIDTH=80%>"
  136.         table=1;
  137.         horiz=0;
  138.         }
  139.  
  140.         if (horiz==0)
  141.         {
  142.         print "<TR>"
  143.         }
  144.  
  145.         print "<TD WIDTH=25%>"
  146.         print "<A HREF=\""$4"\">"$3"()</A> "
  147.         print "</TD>"
  148.         horiz++;
  149.  
  150.         if (horiz==cols)
  151.         {
  152.         print "</TR>"
  153.         horiz=0;
  154.         }
  155.     }
  156.     }
  157.     if (mode=="pre_byname")
  158.     {
  159.     first=substr($2,1,1);
  160.     initials=initials first;
  161.     file=$1;
  162.     gsub("..\/html\/","",file);
  163.     print toupper(first)":"$2":"file;
  164.     }
  165.     else if (mode=="post_byname")
  166.     {
  167.     if ($1=="-")
  168.     {
  169.         print "<DT><A NAME=\"byname\"></A><FONT SIZE=\"+2\"><B>A.3 Reference by name</B></FONT><DD>"
  170.  
  171.         for (t=1; t<=length($2); t++)
  172.         {
  173.         char=substr($2,t,1);
  174.         print "<A HREF=\"#name"char"\"><FONT SIZE=\"+1\"><B>"char"</B></FONT></A> "
  175.         }
  176.  
  177.         print "<P><DL>"
  178.         dl++;
  179.  
  180.         char="-";
  181.     }
  182.     else
  183.     {
  184.         if (char!=$1)
  185.         {
  186.         if (table)
  187.         {
  188.             while (horiz && horiz < cols)
  189.             {
  190.             print "<TD WIDTH=25%> </TD>"
  191.             horiz++;
  192.             }
  193.             print "</TR></TABLE>"
  194.             table=0;
  195.         }
  196.  
  197.         if (char != "-")
  198.         {
  199.             print "</DL><P>"
  200.             dl--;
  201.         }
  202.         else
  203.             print "<P>"
  204.  
  205.         char = $1;
  206.  
  207.         print "<DT><A NAME=\"name"char"\"></A><B>"char"</B><DD>"
  208.         print "<DL>"
  209.         dl++;
  210.  
  211.         print "<TABLE WIDTH=80%>"
  212.         table=1;
  213.         horiz=0;
  214.         }
  215.  
  216.         if (horiz==0)
  217.         {
  218.         print "<TR>"
  219.         }
  220.  
  221.         print "<TD WIDTH=25%>"
  222.         print "<A HREF=\"" $3 "\">" $2 "()</A>"
  223.         print "</TD>"
  224.  
  225.         horiz++;
  226.  
  227.         if (horiz==cols)
  228.         {
  229.         print "</TR>"
  230.         horiz=0;
  231.         }
  232.     }
  233.     }
  234. }
  235. END {
  236.     if (mode=="pre_bylib")
  237.     {
  238.     alphabeth="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  239.  
  240.     for (lib in libs)
  241.     {
  242.         out="";
  243.         for (t=1; t<=26; t++)
  244.         {
  245.         if (index(libs[lib],substr(alphabeth,t,1)))
  246.             out=out substr(alphabeth,t,1);
  247.         }
  248.         print "-:"lib":"out;
  249.     }
  250.     }
  251.     else if (mode=="post_bylib")
  252.     {
  253.     if (table)
  254.     {
  255.         while (horiz && horiz < cols)
  256.         {
  257.         print "<TD WIDTH=25%> </TD>"
  258.         horiz++;
  259.         }
  260.         print "</TABLE>"
  261.     }
  262.     while (dl--)
  263.         print "</DL>"
  264.     }
  265.     if (mode=="pre_byname")
  266.     {
  267.     alphabeth="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  268.     out="";
  269.     for (t=1; t<=26; t++)
  270.     {
  271.         if (index(initials,substr(alphabeth,t,1)))
  272.         out=out substr(alphabeth,t,1);
  273.     }
  274.     print "-:" out;
  275.     }
  276.     else if (mode=="post_byname")
  277.     {
  278.     if (table)
  279.     {
  280.         while (horiz && horiz < cols)
  281.         {
  282.         print "<TD WIDTH=25%> </TD>"
  283.         horiz++;
  284.         }
  285.         print "</TABLE>"
  286.     }
  287.     while (dl--)
  288.         print "</DL>"
  289.     }
  290. }
  291.